package com.xiaoshuidi.cloud.module.member.mq.consumer;

import com.xiaoshuidi.cloud.module.member.mq.message.VerifyCodeMessage;
import com.xiaoshuidi.cloud.module.member.service.activities.MemberActivitiesEnrollService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.function.Consumer;

@Slf4j
@Component("memberVerifyCodeConsumer")
public class MemberVerifyCodeConsumer implements Consumer<VerifyCodeMessage> {
    @Resource
    private MemberActivitiesEnrollService memberActivitiesEnrollService;

    @Override
    public void accept(VerifyCodeMessage verifyCodeMessage) {
        log.info("[accept][消息内容({})]", verifyCodeMessage);
        memberActivitiesEnrollService.doVerifyCodeMessage(verifyCodeMessage);
    }
}
